#pragma once

namespace A {
	template<class Iterator,class Ref,class Ptr>
	struct reverse_iterator {
		typedef reverse_iterator<Iterator, Ref, Ptr> Self;

		Iterator _it;

		reverse_iterator(Iterator it)
			:_it(it)
		{}

		Ref operator*() const{
			Iterator tmp = _it;
			return *--tmp;
		}

		Ptr operator->()const {
			return &(operator*());
		}

		Self& operator++() {
			--_it;
			return *this;
		}

		Self& operator--() {
			++_it;
			return *this;
		}

		 

		bool operator!=(const Self& x) {
			return _it != x._it;
		}
	};
}
